<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>支付</title>
    <script src="__INDEX__/js/mui.min.js"></script>
	<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/css/mall.css" />
	<link rel="stylesheet" href="__INDEX__/css/LArea.css" />
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">确认商品</h1>
	</header>
	<form id="my_form" class="layui-form update_form" action="{:url('topay')}" method="post">
		<input type="hidden" name="goods_id" value="{$goods.id}" />
		<nav class="mui-bar mui-bar-tab pay_bar_tab">
		    <button type="submit" class="right" style="width: 100%;">确认商品</button>
		</nav>
		<div class="mui-content quer_content">
		    <div class="pay_ordinfo">
		    	<p class="pay_ord_dpmc"><span class="iconfont icon-dianpu"></span>{$agent.agent_name}</p>
		    	<ul class="pay_ord_list">
		    		<li>
		    			<div class="pay_ord_sp clearfix">
				    		<div class="pay_sp_img"><img src="{$goods.thumb}"></div>
				    		<div class="pay_sp_info">
				    			<p class="pay_spnam">{$goods.goods_name}</p>
				    			<p class="pay_glj">鼓励金抵扣{$goods.dk_price}</p>
				    			<p class="pay_sppribox clearfix">
				    				<span class="pay_sppri">¥{$goods.sale_price}</span>				    				
				    			</p>
				    		</div>
				    	</div>
		    		</li>		    		
		    	</ul>
		    	<div class="pay_gmnum clearfix">
					<div class="pay_gmsl">购买数量</div>
					<div class="mui-collapse-content">
						<div class="mui-numbox">
							<button class="mui-btn mui-btn-numbox-minus " id='num_jian' type="button">-</button>
							<input id="goods_num" name="nums" readonly="readonly"  class="mui-input-numbox" type="number" value="1">
							<button id="num_jia" class="mui-btn mui-btn-numbox-plus" type="button">+</button>
						</div>
					</div>
				</div>
		    	<div class="pay_ord_liuy">
		    		<label>买家留言:</label>
		    		<input type="text" name="content" placeholder="选填（对本次交易的说明）"></input>
		    	</div>
		    	<div class="pay_ord_zj">
		    		<span>共<em>1</em>件商品</span>
		    		<span>小计：<em id="total">¥{$goods.sale_price}</em></span>
		    	</div>
		    </div>  
		</div>
	</form>
</body>
</html>
{include file="public/footer" /}
<script>
	//加减购买数量
	$('#num_jian').click(function(){
		var goods_num = $('#goods_num').val();
		if(goods_num<=1){
			goods_num=1;
			$("#num_jian").addClass("mui-disabled");
			$('#goods_num').val(1);
		}else{
			$("#num_jian").removeClass("mui-disabled"); 
		}
		var price='{$goods.sale_price}';
		$('#total').text((parseFloat(price)*goods_num).toFixed(2));
	});
	$('#num_jia').click(function(){
		var goods_num = $('#goods_num').val();
		var price='{$goods.sale_price}';
		$('#total').text((parseFloat(price)*goods_num).toFixed(2));
	});
</script>